<template>
  <svg :class="svgClass" aria-hidden="true">
    <use :xlink:href="iconName" />
  </svg>
</template>

<script lang="ts" setup>
// const props = defineProps<{
//   iconClass: string;
//   className?: string;
// }>();
import { computed } from "vue";
interface Props {
  iconClass: string;
  isActive: boolean;
  className?: string;
}

const props = withDefaults(defineProps<Props>(), {
  iconClass: "",
  className: "",
  isActive: false,
});
let iconName = computed(() => {
  return `#icon-${props.iconClass}`;
});

let svgClass = computed(() => {
  if (props.className) {
    return "svg-icon " + props.className;
  } else {
    return "svg-icon";
  }
});
</script>

<style scoped>
.svg-icon {
  width: 6vw;
  height: 6vw;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
